{% extends "base.html" %}

{% block content %}
<div class="container mt-4">
    <h2>两步验证(2FA)设置</h2>
    <div class="card">
        <div class="card-body">
            {% if current_user.otp_enabled %}
                <div class="alert alert-success">
                    两步验证(2FA)已启用
                </div>
                <form method="POST">
                    <button type="submit" name="disable" class="btn btn-danger">禁用2FA</button>
                </form>
            {% else %}
                <p>两步验证(2FA)为您的账户提供额外的安全保护。</p>
                <form method="POST">
                    <button type="submit" name="enable" class="btn btn-primary">启用2FA</button>
                </form>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
